import { BLOG_STATUS } from '@/constants/common/blog-status';
import { AUDIT_STATUS } from '@/constants/common/audit-status';

/**
 * 基础查询参数
 */
export interface PageQuery {
  page?: number;
  limit?: number;
}

/**
 * 博客查询参数
 */
export interface BlogQuery extends PageQuery {}

/**
 * 甘特图查询参数
 */
export interface ganttQueryParam {
  startDate: string;
  endDate: string;
}

/**
 * 博客详细信息
 */
export interface BlogInfo {
  blogId?: string;
  rowNumber?: number;
  blogTitle: string;
  avatar?: string;
  author?: string;
  blogSubUrl?: string;
  blogCoverImage: string;
  imageBase64Str?: string;
  blogCategoryId?: string;
  blogCategoryName?: string;
  blogTags: string[];
  blogStatus?: string;
  blogStatusName?: string;
  blogViews?: number;
  likes?: number;
  importance?: boolean;
  enableComment?: boolean;
  isDeleted?: boolean;
  publishTime?: Date | string;
  createTime?: Date | string;
  createBy?: string;
  updateTime?: Date | string;
  updateBy?: string;
  blogContent: string;
  blogContentType?: string;
}

/**
 * 博客分页响应
 */
export interface BlogResponse {
  list: BlogInfo[];
  total: number;
}

/**
 * 甘特图博客文章
 */
export interface BlogPost {
  blogId: string;
  blogTitle: string;
  blogCategoryName: string;
  blogStatus: BLOG_STATUS;
  blogTags: string[];
  progress: number;
  startDate: string;
  endDate: string;
  summary?: string;
  contentLink: string;
  createdAt: string;
  updatedAt: string;
  dependencies: string[];
  collectionId: string;
}

/**
 * 文章依赖关系
 */
export interface PostDependency {
  id: string;
  sourcePost: string;
  targetPost: string;
  relationType: 'finish-to-start' | 'start-to-start' | 'finish-to-finish' | 'start-to-finish';
  createdAt: string;
}

/**
 * 里程碑
 */
export interface PostMilestone {
  id: string;
  postId?: string;
  name: string;
  date: string;
  priority: number;
  description?: string;
  completed: boolean;
  createdAt: string;
}

/**
 * 甘特图数据响应
 */
export interface GanttDataResponse {
  posts: BlogPost[];
  dependencies: PostDependency[];
  milestones: PostMilestone[];
}
